##############################################################
#Table C2: Reduced Form: Strongest Hurricane Exposure and Democrat Vote}
##############################################################

data <- read.dta13("./input/cces-strongest.dta")

library(lmtest)
library(sandwich)

m1 <- lm(dem14~logd, data=data)
m1.rob <- coeftest(m1, vcov = vcovHC(m1, type="HC1")) 
m2 <- lm(dem14~logd +factor(race_14) + factor(education) + female  + factor(income_quarters) + 
           employed + out_of_labour +  age, data=data)
m2.rob <- coeftest(m2, vcov = vcovHC(m2, type="HC1")) 
stargazer(m1.rob, m2.rob, 
          title="Reduced Form: Strongest Hurricane Exposure and Democrat Vote", 
          out=paste("./figures/tabc2", ".tex", sep=""),
          keep=c("logd", "logd"),
          keep.stat = c("n","rsq"))
stargazer(m1, m2) ## to obtain N and RSQ





